home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIWebNavigation.idl < prev    next >
Encoding:
Text File  |  2006-05-08  |  10.4 KB  |  284 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  * ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is the Mozilla browser.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications, Inc.
  19.  * Portions created by the Initial Developer are Copyright (C) 1999
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Travis Bogard <travis@netscape.com>
  24.  *   Darin Fisher <darin@meer.net>
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  28.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #include "nsISupports.idl"
  41.  
  42. interface nsIDOMDocument;
  43. interface nsIInputStream;
  44. interface nsISHistory;
  45. interface nsIURI;
  46.  
  47. /**
  48.  * The nsIWebNavigation interface defines an interface for navigating the web.
  49.  * It provides methods and attributes to direct an object to navigate to a new
  50.  * location, stop or restart an in process load, or determine where the object
  51.  * has previously gone.
  52.  *
  53.  * @status UNDER_REVIEW
  54.  */
  55. [scriptable, uuid(F5D9E7B0-D930-11d3-B057-00A024FFC08C)]
  56. interface nsIWebNavigation : nsISupports
  57. {
  58.   /**
  59.    * Indicates if the object can go back.  If true this indicates that
  60.    * there is back session history available for navigation.
  61.    */
  62.   readonly attribute boolean canGoBack;
  63.  
  64.   /**
  65.    * Indicates if the object can go forward.  If true this indicates that
  66.    * there is forward session history available for navigation
  67.    */
  68.   readonly attribute boolean canGoForward;
  69.  
  70.   /**
  71.    * Tells the object to navigate to the previous session history item.  When a
  72.    * page is loaded from session history, all content is loaded from the cache
  73.    * (if available) and page state (such as form values and scroll position) is
  74.    * restored.
  75.    *
  76.    * @throw NS_ERROR_UNEXPECTED
  77.    *        Indicates that the call was unexpected at this time, which implies
  78.    *        that canGoBack is false.
  79.    */
  80.   void goBack();
  81.  
  82.   /**
  83.    * Tells the object to navigate to the next session history item.  When a
  84.    * page is loaded from session history, all content is loaded from the cache
  85.    * (if available) and page state (such as form values and scroll position) is
  86.    * restored.
  87.    *
  88.    * @throw NS_ERROR_UNEXPECTED
  89.    *        Indicates that the call was unexpected at this time, which implies
  90.    *        that canGoForward is false.
  91.    */
  92.   void goForward();
  93.  
  94.   /**
  95.    * Tells the object to navigate to the session history item at a given index.
  96.    *
  97.    * @throw NS_ERROR_UNEXPECTED
  98.    *        Indicates that the call was unexpected at this time, which implies
  99.    *        that session history entry at the given index does not exist.
  100.    */
  101.   void gotoIndex(in long index);
  102.  
  103.   /****************************************************************************
  104.    * The following flags may be bitwise combined to form the load flags
  105.    * parameter passed to either the loadURI or reload method.  Some of these
  106.    * flags are only applicable to loadURI.
  107.    */
  108.  
  109.   /**
  110.    * This flags defines the range of bits that may be specified.
  111.    */
  112.   const unsigned long LOAD_FLAGS_MASK            = 0xffff;
  113.  
  114.   /**
  115.    * This is the default value for the load flags parameter.
  116.    */
  117.   const unsigned long LOAD_FLAGS_NONE            = 0x0000;
  118.  
  119.   /**
  120.    * This flag specifies that the load should have the semantics of an HTML
  121.    * Meta-refresh tag (i.e., that the cache should be bypassed).  This flag
  122.    * is only applicable to loadURI.
  123.    * XXX the meaning of this flag is poorly defined.
  124.    * XXX no one uses this, so we should probably deprecate and remove it.
  125.    */
  126.   const unsigned long LOAD_FLAGS_IS_REFRESH      = 0x0010;
  127.  
  128.   /**
  129.    * This flag specifies that the load should have the semantics of a link
  130.    * click.  This flag is only applicable to loadURI.
  131.    * XXX the meaning of this flag is poorly defined.
  132.    */
  133.   const unsigned long LOAD_FLAGS_IS_LINK         = 0x0020;
  134.  
  135.   /**
  136.    * This flag specifies that history should not be updated.  This flag is only
  137.    * applicable to loadURI.
  138.    */
  139.   const unsigned long LOAD_FLAGS_BYPASS_HISTORY  = 0x0040;
  140.  
  141.   /**
  142.    * This flag specifies that any existing history entry should be replaced.
  143.    * This flag is only applicable to loadURI.
  144.    */
  145.   const unsigned long LOAD_FLAGS_REPLACE_HISTORY = 0x0080;
  146.  
  147.   /**
  148.    * This flag specifies that the local web cache should be bypassed, but an
  149.    * intermediate proxy cache could still be used to satisfy the load.
  150.    */
  151.   const unsigned long LOAD_FLAGS_BYPASS_CACHE    = 0x0100;
  152.  
  153.   /**
  154.    * This flag specifies that any intermediate proxy caches should be bypassed
  155.    * (i.e., that the content should be loaded from the origin server).
  156.    */
  157.   const unsigned long LOAD_FLAGS_BYPASS_PROXY    = 0x0200;
  158.  
  159.   /**
  160.    * This flag specifies that a reload was triggered as a result of detecting
  161.    * an incorrect character encoding while parsing a previously loaded
  162.    * document.
  163.    */
  164.   const unsigned long LOAD_FLAGS_CHARSET_CHANGE  = 0x0400;
  165.  
  166.   /**
  167.    * If this flag is set, Stop() will be called before the load starts
  168.    * and will stop both content and network activity (the default is to
  169.    * only stop network activity).  Effectively, this passes the
  170.    * STOP_CONTENT flag to Stop(), in addition to the STOP_NETWORK flag.
  171.    */
  172.   const unsigned long LOAD_FLAGS_STOP_CONTENT    = 0x0800;
  173.  
  174.   /**
  175.    * A hint this load was prompted by an external program: take care!
  176.    */
  177.   const unsigned long LOAD_FLAGS_FROM_EXTERNAL   = 0x1000;
  178.  
  179.   /**
  180.    * Loads a given URI.  This will give priority to loading the requested URI
  181.    * in the object implementing    this interface.  If it can't be loaded here
  182.    * however, the URI dispatcher will go through its normal process of content
  183.    * loading.
  184.    *
  185.    * @param aURI
  186.    *        The URI string to load.  For HTTP and FTP URLs and possibly others,
  187.    *        characters above U+007F will be converted to UTF-8 and then URL-
  188.    *        escaped per the rules of RFC 2396.
  189.    * @param aLoadFlags
  190.    *        Flags modifying load behaviour.  This parameter is a bitwise
  191.    *        combination of the load flags defined above.  (Undefined bits are
  192.    *        reserved for future use.)  Generally you will pass LOAD_FLAGS_NONE
  193.    *        for this parameter.
  194.    * @param aReferrer
  195.    *        The referring URI.  If this argument is null, then the referring
  196.    *        URI will be inferred internally.
  197.    * @param aPostData
  198.    *        If the URI corresponds to a HTTP request, then this stream is
  199.    *        appended directly to the HTTP request headers.  It may be prefixed
  200.    *        with additional HTTP headers.  This stream must contain a "\r\n"
  201.    *        sequence separating any HTTP headers from the HTTP request body.
  202.    *        This parameter is optional and may be null.
  203.    * @param aHeaders
  204.    *        If the URI corresponds to a HTTP request, then any HTTP headers
  205.    *        contained in this stream are set on the HTTP request.  The HTTP
  206.    *        header stream is formatted as:
  207.    *            ( HEADER "\r\n" )*
  208.    *        This parameter is optional and may be null.
  209.    */
  210.   void loadURI(in wstring        aURI,
  211.                in unsigned long  aLoadFlags,
  212.                in nsIURI         aReferrer,
  213.                in nsIInputStream aPostData,
  214.                in nsIInputStream aHeaders);
  215.  
  216.   /**
  217.    * Tells the Object to reload the current page.  There may be cases where the
  218.    * user will be asked to confirm the reload (for example, when it is
  219.    * determined that the request is non-idempotent).
  220.    *
  221.    * @param aReloadFlags
  222.    *        Flags modifying load behaviour.  This parameter is a bitwise
  223.    *        combination of the Load Flags defined above.  (Undefined bits are
  224.    *        reserved for future use.)  Generally you will pass LOAD_FLAGS_NONE
  225.    *        for this parameter.
  226.    *
  227.    * @throw NS_BINDING_ABORTED
  228.    *        Indicating that the user canceled the reload.
  229.    */
  230.   void reload(in unsigned long aReloadFlags);
  231.  
  232.   /****************************************************************************
  233.    * The following flags may be passed as the stop flags parameter to the stop
  234.    * method defined on this interface.
  235.    */
  236.  
  237.   /**
  238.    * This flag specifies that all network activity should be stopped.  This
  239.    * includes both active network loads and pending META-refreshes.
  240.    */
  241.   const unsigned long STOP_NETWORK = 0x01;
  242.  
  243.   /**
  244.    * This flag specifies that all content activity should be stopped.  This
  245.    * includes animated images, plugins and pending Javascript timeouts.
  246.    */
  247.   const unsigned long STOP_CONTENT = 0x02;
  248.  
  249.   /**
  250.    * This flag specifies that all activity should be stopped.
  251.    */
  252.   const unsigned long STOP_ALL     = 0x03;
  253.  
  254.   /**
  255.    * Stops a load of a URI.
  256.    *
  257.    * @param aStopFlags
  258.    *        This parameter is one of the stop flags defined above.
  259.    */
  260.   void stop(in unsigned long aStopFlags);
  261.  
  262.   /**
  263.    * Retrieves the current DOM document for the frame, or lazily creates a
  264.    * blank document if there is none.  This attribute never returns null except
  265.    * for unexpected error situations.
  266.    */
  267.   readonly attribute nsIDOMDocument document;
  268.  
  269.   /**
  270.    * The currently loaded URI or null.
  271.    */
  272.   readonly attribute nsIURI currentURI;
  273.  
  274.   /**
  275.    * The referring URI for the currently loaded URI or null.
  276.    */
  277.   readonly attribute nsIURI referringURI;
  278.  
  279.   /**
  280.    * The session history object used by this web navigation instance.
  281.    */
  282.   attribute nsISHistory sessionHistory;
  283. };
  284.